/**
 * Created by ajhin on 9/29/2014.
 */
package
{
import com.societyGames.codeExercise.CodeExercise;
import com.societyGames.outputMagicNumberExercises.OutputMagicNumberCodeExercise;

public function getMagicNumberOnce():Number
{
  var outputMagicNumberCodeExercise:OutputMagicNumberCodeExercise = OutputMagicNumberCodeExercise(CodeExercise.instance);
  if (outputMagicNumberCodeExercise.hasGotten)
  {
    throw new Error("Cannot call getMagicNumberOnce more than once.");
  }
  outputMagicNumberCodeExercise.hasGotten = true;
  return outputMagicNumberCodeExercise.magicNumber;
}
}
